<template>
          <el-menu
                active-text-color="#363ca5"
                text-color="#666"
                router
            >

            <el-sub-menu v-for="menu in menuList.menuData" :index="menu.mid + ''">
            <template #title>
                <el-icon><component :is="menu.glyphicon"></component></el-icon>
                <span>{{ menu.menuname }}</span>
            </template>
            <el-menu-item v-for="subm in menu.subMenu" :index="subm.url">
                <el-icon><component :is="subm.glyphicon"></component></el-icon>
                <span >{{ subm.menuname }}</span>
            </el-menu-item>

            </el-sub-menu>
      </el-menu>
</template>

<script setup>
import {ref,reactive,onMounted} from 'vue'
import {get,post} from '@/myaxios'
import router from '@/router'

const menuList = reactive({menuData:[]})

//点击菜单跳转页面
// const goPage = (currentUrl)=>{
//     router.push(currentUrl)
// }

onMounted(async ()=>{
  let resp = await  get('/getUserMenus',{});
  console.log(resp.data);
  
  //后端取值
  menuList.menuData = resp.data.returnData;


})

</script>

<style scoped>

</style>